oldname = input('输入被备份的文件名')
index = oldname.rfind('.')
newname = oldname[:index] + '[备份]' + oldname[index:]
print(newname)

f1 = open(oldname, 'rb')
f2 = open(newname, 'wb')
while True:
    con = f1.read(1024)
    if len(con) == 0:
        break
    f2.write(con)
f1.close()
f2.close()
